# from application import app, manager
from application import app
# from flask_script import Server
import www  # 导入了蓝图，注册蓝图


##web server
# manager.add_command( "runserver", Server( host='0.0.0.0',port=app.config['SERVER_PORT'],use_debugger = True ,use_reloader = True) )
# manager.add_command("runserver", Server(host='127.0.0.1', port=app.config['SERVER_PORT'], use_debugger=True, use_reloader=True))
#

def main():
    # 目前的路由列表
    print(app.url_map)
    # manager.run()
    app.run(debug=app.config['DEBUG'], port=app.config['SERVER_PORT'])


if __name__ == '__main__':
    try:
        import sys
        sys.exit(main())
    except Exception as e:
        import traceback

        traceback.print_exc()
